#!/usr/bin/perl


while($line=<STDIN>) {
	chomp($line);
	($left,$right) = split(/\s+/,$line);
	@components = split(/\-+/,$left);
	$numCom = $#components;
	$hist{$numCom}++;
}

foreach $key (sort {$a<=>$b} keys %hist) {
	print $key."\t".$hist{$key}."\n";
}
